home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
-
- short contrl[12],
- intin[128],
- ptsin[128],
- intout[128],
- ptsout[128];
-
- short handle,
- phys_handle,
- wi_handle,
- ap_id,
- chw, chh, cbw, cbh;
-
- short work_in [12],
- work_out[57];
-
- short wiwx[15], witx[15],
- wiwy[15], wity[15],
- wiww[15], witw[15],
- wiwh[15], with[15];
-
- short scrap0, scrap1, scrap2, scrap3;
-
- /*
- ** Initialization routines
- */
-
- begin_appl ()
- {
- int i;
-
- ap_id = appl_init ();
- for (i=0; i<10; work_in[i++] = 1);
- work_in[10] = 0;
- phys_handle = graf_handle (&chw, &chh, &cbw, &cbh);
- handle = phys_handle;
- v_opnvwk (work_in, &handle, work_out);
- }
-
- end_appl ()
- {
- v_clsvwk (handle);
- appl_exit ();
- term0 ();
- }
-
- aes (code, i)
- int code, i;
- {
- static char s[] = "[3][FATAL ERROR:|AES error xx detected][Exit to TOS]";
- if (i==0)
- {
- s[28] = (code % 10) + '0';
- s[27] = (code / 10) + '0';
- err (s);
- end_appl();
- }
- return (i);
- }
-
- err (s)
- char *s[];
- {
- return (form_alert (1, s));
- }
-
- dialog (tree)
- int tree;
- {
- short x, y, h, w, button;
-
- aes (90, form_center (tree, &x, &y, &w, &h));
- form_dial (0, 340, 190, 20, 20, x, y, w, h);
- aes (92, form_dial (1, 340, 190, 20, 20, x, y, w, h));
- aes (93, objc_draw (tree, 0, 4, x, y, w, h));
- button = form_do (tree, 0);
- aes (94, form_dial (3, 340, 190, 20, 20, x, y, w, h));
- aes (95, form_dial (2, 340, 190, 20, 20, x, y, w, h));
- return (button);
- }
-
- file (but,path)
- short *but;
- char path[];
- {
- char *ptr, ch;
- int ret;
- char inpath[256], insel[256];
- strcpy (inpath, path);
- strcpy (insel, "");
- ret = fsel_input (inpath, insel, but);
- strcpy (path, inpath);
- ptr = path;
- while (ch = *ptr++)
- {
- if (ch == '*')
- break;
- }
- --ptr;
- strcpy (ptr, insel);
- }